package com.ln.de1109.demo02;

import java.util.ArrayList;

/**
 * @author Ln
 * @version 终极版
 * @date 2022/11/9 16:35
 */
public class AAAOfficialAccounts implements OfficialAccounts{
    private String msg;

    private ArrayList<UserInterface> list=new ArrayList();

    @Override
    public void guanzhu(UserInterface userInterface) {
        list.add(userInterface);
    }

    @Override
    public void quxiao(UserInterface userInterface) {
        list.remove(userInterface);
    }

    @Override
    public void setMsg(String msg) {
        this.msg=msg;
    }

    @Override
    public void qunfa() {
        for (UserInterface userInterface :list){
            userInterface.getMsg(msg);
        }
    }
}
